package com.steak.concurrent.CompletableFuture.api.supply;

import java.util.concurrent.*;
import java.util.function.Function;
import java.util.function.Supplier;

/**
 * @author 刘牌
 * @Title:
 * @date 2022/3/2712:36
 */
public class supplyAsyncNoUseExecutors {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
            System.out.println("start async task");
            return "我是小四哥";
        });
        System.out.println(future.get());
    }
}
